package com.hsgene.order.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.common.util.result.NullObject;
import com.hsgene.discount.dto.UserCouponInfoDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 客户优惠券服务
 *
 * @author wangbing
 * @version 1.0, 2018/8/7
 */
@Deprecated
@FeignClient(name = "ms-mod-coupon", path = "/coupon")
public interface CouponService {

    /**
     * 获取用户优惠券信息
     *
     * @param userId   用户id
     * @param couponId 优惠券id
     * @return 优惠券信息
     */
    @GetMapping("")
    ApiResult<UserCouponInfoDto> findUserCoupon(
            @RequestParam("userId") String userId,
            @RequestParam("couponId") String couponId);

    /**
     * 锁定优惠券
     *
     * @param userId   用户id
     * @param couponId 优惠券id
     * @return 锁定优惠券
     */
    @PutMapping("")
    ApiResult<NullObject> lockUserCoupon(
            @RequestParam("userId") String userId,
            @RequestParam("couponId") String couponId);
}
